<?php
$this->title = '商品列表';
?>
<body class="m-cate-list">

<ul class="f-cb" id="J_sltCnt">
    <?php foreach($list as $item) {?>
        <li class="J_forLink" data-url="<?= Yii::$app->request->hostInfo . '/web/product/detail?pid=' . $item['pid']?>">
        <img src="<?=$item['thumb'].'@1e_1c_0o_0l_150h_150w_100q.jpg'?>" />
        <a href="../product/detail?pid=<?=$item['pid']?>"><?=$item['name']?></a>
        <b>￥ <?=$item['price']?></b>
        </li>
    <?php }?>
</ul>

<div class="m-nav f-cb u-bg1">
    <a href="/">首页</a>
    <a href="javascript:;" class="z-on">分类</a>
    <a href="/web/cart/view?shop_id=<?= '1001'//yii::$app->session->get('shop_id')?>">购物车</a>
    <a href="/web/my">我的</a>
</div>

<script>
    $(function(){

        var img = $('#J_sltCnt').find('img');
        img.height(img.eq(0).width()-2);

        // 商品 区域链接 点击
        // demo <li class="J_forLink" data-url="http://git.oschina.net/">
        $(document.body).on('tap', '.J_forLink', function(){

            window.location.href = $(this).attr('data-url');
        });
    });
</script>
</body>